<?php 
// 1.获取数据
$team = $_POST['team'];
$name = $_POST['name'];
$mail = $_POST['mail'];
$password = $_POST['password'];

if (!isset($team)||!isset($name)||!isset($password)||!isset($mail)){
	exit();
}else{
	$conn = mysqli_connect('127.0.0.1','root','123456','super','3306');
	if($conn){
		$select =mysqli_query($conn,"SELECT * FROM users WHERE mail='$mail'");
		$res =mysqli_fetch_array($select);
		if($res['mail']!=$mail){
			mysqli_query($conn,'SET NAMES UTF8');
			$sql = "INSERT INTO users(team,name,mail,password) VALUES('$team','$name','$mail','$password')";
			$result = mysqli_query($conn,$sql);
			if($result){
				header('location:../html/project.php');
			}else{
				echo('注册失败！'.mysqli_error('$conn'));
			}
		}else{
			header('location:../html/register.html');
		}
	}else{
		echo "注册失败,请重试！";
	}
}

 ?>